/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.privacysandbox.ads.adservices.adselection

import androidx.privacysandbox.ads.adservices.common.ExperimentalFeatures
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth
import org.junit.Test
import org.junit.runner.RunWith

@OptIn(ExperimentalFeatures.Ext10OptIn::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
class GetAdSelectionDataOutcomeTest {
    private val adSelectionId = 1234L
    private val adSelectionData = byteArrayOf(0x01, 0x02, 0x03, 0x04)

    @Test
    fun testToString() {
        val result =
            "GetAdSelectionDataOutcome: adSelectionId=$adSelectionId, " +
                "adSelectionData=$adSelectionData"
        val request = GetAdSelectionDataOutcome(adSelectionId, adSelectionData)
        Truth.assertThat(request.toString()).isEqualTo(result)
    }

    @Test
    fun testEquals() {
        val getAdSelectionDataOutcome = GetAdSelectionDataOutcome(adSelectionId, adSelectionData)
        var getAdSelectionDataOutcome2 =
            GetAdSelectionDataOutcome(adSelectionId, byteArrayOf(0x01, 0x02, 0x03, 0x04))
        Truth.assertThat(getAdSelectionDataOutcome == getAdSelectionDataOutcome2).isTrue()
    }
}
